<?php
namespace org\net;
/**
 * 浏览器类型 工具类
 */
class Browser {
    
    
    
    public static function getType(){
        
        $agent    = $_SERVER['HTTP_USER_AGENT'];
        if( !$agent ) return 'no agent';
        $agent    = strtolower($agent);
        $browser  = 'unknow';
        if(strpos($agent,"micromessenger")){
            $browser = "wechat";
        }else if(strpos($agent,"msie")){
            $browser = "explorer";
        }else if(strpos($agent,"firefox")){
            $browser = "firefox";
        }else if(strpos($agent,"chrome")){
            $browser = "chrome";
        }else if(strpos($agent,"safari")){
            $browser = "safari";
        }else if(strpos($agent,"opera")){
            $browser = "opera";
        }
        return $browser;
    
    
    }
    
    
    
    
    
    
}